package com.jy.api.service;

import com.jy.api.domain.Store;
import com.jy.api.domain.StoreProfile;
import com.jy.api.domain.StoreType;
import com.jy.api.service.impl.StoreProfileNotExistException;
import com.jy.api.signUpReq.MarsCallReq.MarsCallRes;
import com.jy.api.signUpReq.MarsCallReq.SetStoreCallTime;
import com.jy.api.signUpReq.MarsCallReq.UpdateRewardReq;
import com.jy.api.signUpReq.MarsCallReq.UpdateStoreReq;
import com.jy.api.signUpReq.SalesCode.MyStoreRes;
import com.jy.api.signUpReq.SalesCode.UpdateSalesCodeReq;
import com.jy.api.signUpReq.admin.SetPswReq;
import com.jy.api.signUpReq.admin.StoreReq;
import com.jy.api.signUpReq.admin.StoreSignUpReq;
import com.jy.api.signUpReq.admin.StoreUpdateReq;
import com.jy.api.util.Result;
import com.jy.api.vo.admin.store.StoreVo;
import com.jy.api.vo.member.StoreMemberInfoVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface StoreService {


    /**
     * 获取用户所有关联店铺列表
     *
     * @param userName
     * @param status   true 为获取所以关联店铺 false  获取所有报表权限店铺
     * @return
     */
    List<StoreVo> getStores(String userName, boolean status) throws ParseException;

    /**
     * 新增店铺
     *
     * @param storeId
     * @param storeOrder
     * @param username
     * @param storeType
     * @return
     */
    Store addStore(String storeId, StoreSignUpReq storeOrder,
                   String username, StoreType storeType) throws IOException;


    void updateStore(StoreReq storeReq);


    /**
     * 更新店铺支付设置
     *
     * @param storeId store id
     * @param mchId   商户号／邮件中的"登录账号"
     * @param key     秘钥
     */
    void updatePaymentCfg(String storeId, String mchId, String key) throws StoreProfileNotExistException;



    Page<StoreProfile> getALLProfile(String userName,Pageable pageable);








    /**
     * 会员所在店铺模糊查询
     *
     * @return
     */
    List<com.jy.api.vo.member.StoreVo> getMemberStoreLike(String memberId, String q);

    /**
     * 会员所在店铺模糊查询
     *
     * @return
     */
    List<com.jy.api.vo.member.StoreVo> getMemberAllStoreLike(String q);

    /**
     * 获取会员对应店铺信息
     *
     * @param memberId
     * @return
     */
    List<StoreMemberInfoVo> getStoreIndo(String memberId, Pageable pageable);

    /**
     * 上传客户端相关文件
     */
    String creatClient(String storeId);


    /**
     * IE 生成
     *
     * @param storeId
     * @return
     */
    String creatClientBat(String storeId);

    String getUrl(String storeId);

    MarsCallRes findMarsCallIndex(String storeId);

    Map<String, Object> updateStoreByStoreId(UpdateStoreReq req);

    Result updateStoreByZero(UpdateRewardReq req);

    Result updateStoreByDiscount(UpdateRewardReq req);

    Map<String, Object> updateReward(UpdateRewardReq req);

    List<Store> likeStoreName(String name);

    Map<String, Object> setStoreSecond(SetStoreCallTime callTime);

    Map<String, Object> updateStoreById(StoreUpdateReq req);

    List<Store> findByStoreNameLike(String name);

    Result setPsw(SetPswReq req);

    Result judgePsw(SetPswReq req);

    List<MyStoreRes> getMyStore(String userName);

    Page<Store> getAllStore(String userName, Pageable pageable);

    Result updateStoreExp(UpdateSalesCodeReq req);
}
